//
//  avTools.m
//  XWZ_News_Work
//
//  Created by dllo on 16/1/12.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "avTools.h"

@implementation avTools

+ (instancetype)sharePlayer
{
    static avTools *myAvTools = nil;
    static dispatch_once_t once;
    dispatch_once(&once, ^{
        myAvTools = [[avTools alloc] init];
    });
    return myAvTools;
}

- (void)playWithURL:(NSString *)url
{
    NSURL *myURL = [NSURL URLWithString:url];
    AVPlayerItem *playItem = [AVPlayerItem playerItemWithURL:myURL];
    [self replaceCurrentItemWithPlayerItem:playItem];
    [self play];
}

@end
